/*
 * drive_server.h
 *
 *  Created on: Jan 24, 2013
 *      Author: michiel
 */

#ifndef DRIVE_SERVER_H_
#define DRIVE_SERVER_H_

#include <sensor_msgs/Joy.h>

#include "servers/base_server.h"
#include "PS3Controller/PS3_buttons.h"
#include "rp_states/DriveAction.h"

class DriveAction : public BaseServer {
	/*
	 * VARIABLES
	 */
private:
	double forward_vel_;
	double turn_rate_;
	actionlib::SimpleActionServer<rp_states::DriveAction> _as;

	rp_states::DriveResult _result;
	rp_states::DriveFeedback _feedback;
	/*
	 * FUNCTIONS
	 */
protected:
	ros::Subscriber controller_sub_;
	void controllerCallback(const sensor_msgs::Joy::ConstPtr &msg);
public:
	DriveAction(std::string name);
	~DriveAction();
	void execute(const rp_states::DriveGoalConstPtr &goal);
};

#endif /* DRIVE_SERVER_H_ */
